help joinitem

JOINITEM <in_info_file> <join_info_file> <out_info_file> <relate_item>
         <start_item> {LINEAR | ORDERED | LINK}
 
merges two INFO data files based on a shared item.
 
 
 
arguments
 
<in_info_file> - the INFO data file to which items and their values are
to be added.
 
<join_info_file> - the INFO data file that contains the items and values
to be added.
 
<out_info_file> - the INFO data file produced by JOINITEM.  If
<out_info_file> already exists, it will be replaced.
 
<relate_item> - an item contained in <in_info_file> which is used as an
index to records in <join_info_file>.  This can be a redefined item.
 
<start_item> - the item in the <in_info_file> list after which the
<join_info_file> items will be inserted.
 
{LINEAR | ORDERED | LINK} - how <join_info_file> records are matched to
<in_info_file> records.
 
LINEAR - the values written to <out_info_file> are merged from
<in_info_file> and <join_info_file> records with matching <relate_item>
values.  The <relate_item> must exist for both files.  Both files can be
sorted in any order.  This is the default option.
 
ORDERED - the <join_info_file> must be sorted on <relate_item>.  Both
the <join_info_file> and <in_info_file> must contain the <relate_item>.
 
LINK - only <in_info_file> must contain <relate_item>.  The
<in_info_file>  can be sorted in any order.  The <relate_item> value in
each record of <in_info_file> indicates the record number in
<join_info_file> which is to be merged.  This method is used when
relating an INFO file to another file on the basis of its internal
record number.
 
 
 
notes
 
JOINITEM can be used with any INFO data file, including files not
created by ARC/INFO commands.  However, items which will be used by
ARC/INFO must have compatible definitions.  The INFO <relate_item> must
always have an ARC/INFO-compatible definition.
 
When specifying the <start_item>, do not insert the items to be joined
before the User-ID (Cover-ID) in any feature attribute table.
 
If a duplicate item is encountered, the item in the <in_info_file> will
be maintained and the one in the <join_info_file> will be dropped.
 
The speed of execution will depend on the organization of the files
being joined.  In general, LINK is the fastest matching operation, then
LINEAR with an indexed <relate_item>, and then ORDERED.  Although the
fastest option, LINK cannot be applied to most cases.
 
The LINEAR option is optimized if the <relate_item> has been indexed.
Refer to the INDEXITEM command for instructions on creating an item
index.
 
The <in_info_file> and <join_info_file> can contain redefined items.  A
redefined item can be used as the <relate_item> in most cases.  When a
redefined item contains items of different types and is numeric, its use
as the <relate_item> is not recommended.  Such a redefined item can
result in illogical or untranslatable numbers.
 
If the <join_info_file> contains more than one record for each
<relate_item> value, the first record encountered by JOINITEM will be
used.
 
After modifying the VAT of a grid using JOINITEM, INDEXITEM must be used
to index the VAT on the item named VALUE.
 
 
discussion
 
JOINITEM combines two INFO data files.  Both the item definitions and
the values of the two files are merged to create the output file.
 
The set of items in the output file is formed by inserting the item
definitions from the join file after the specified start item in the
input file.  Only those join file items which are not in the input file
are merged.  When the same item name occurs in both files, the input
file definition and values take precedence.
 
Item values are merged using INFO relate logic.  A record in the join
file is matched to each record of the input file when their relate item
values are equal.  Then the item values from the two records are copied
to the output file.
 
The join type specifies the method for matching records.  The matching
process in both the LINEAR and ORDERED options can entail searching the
entire join file for a record with a relate item value which is the same
as the relate item value in a given input file record.  One search of
the join file is made for every record of the input file.  A sequential
search is used when LINEAR is specified, and a binary search is used
with the ORDERED option.  If the join file is large, the ORDERED option
normally results in faster execution.  The join file must be sorted in
ascending order by the relate item to use the ORDERED option.
 
With the LINK option, only the input file must contain the relate item.
The relate item in each record of the input file will be linked to the
record number in the join file to be merged.  There is no searching to
match relate item values, so execution is fast.
 
In most cases, the input file and join file should be arranged so that
each record in either file can be matched to one, and only one, record
in the other.  If this one-to-one correspondence does not exist, one of
the following will occur:
 
- An input file record can be matched to more than one join file record.
 
In this case, only one of the join file records will be merged with each
input record.  Data contained in any other matching records will not
appear in the output file.  The record selected for this case may differ
between indexed and non-indexed relate items; when an item is indexed,
you cannot be sure of getting the first occurrence in the file.
 
- An input file record cannot be matched to any join file record.
 
In this case, the corresponding output file record will contain zero or
blank values for the join file items.
 
- A join file record is matched to more than one input file record.
 
In this case, the join file record is merged with each matching input
file record.  The data appear repeatedly in the output file.
 
- A join file record cannot be matched to any input file record.
 
In this case, it is not merged, and the data does not appear in the
output file.

